
<%@ page import="module.blog.Article" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'article.label', default: 'Article')}" />
  <title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
    <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">
    <h1><g:message code="default.list.label" args="[entityName]" /></h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <div class="list">
      <table>
        <thead>
          <tr>

        <g:sortableColumn property="id" title="${message(code: 'article.id.label', default: 'Id')}" />

        <th><g:message code="article.articleClass.label" default="Article Class" /></th>

        <g:sortableColumn property="title" title="${message(code: 'article.title.label', default: 'Title')}" />

        <g:sortableColumn property="viewTimes" title="${message(code: 'article.viewTimes.label', default: 'View Times')}" />

        <g:sortableColumn property="content" title="${message(code: 'article.content.label', default: 'Content')}" />

        <g:sortableColumn property="createAt" title="${message(code: 'article.createAt.label', default: 'Create At')}" />

        <g:sortableColumn property="lastModifyAt" title="${message(code: 'article.lastModifyAt.label', default: 'Last Modify At')}" />

        </tr>
        </thead>
        <tbody>
        <g:each in="${articleInstanceList}" status="i" var="articleInstance">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

            <td><g:link action="show" id="${articleInstance.id}">${fieldValue(bean: articleInstance, field: "id")}</g:link></td>

          <td>${articleInstance.articleClass?module.blog.ArticleClass.get(articleInstance.articleClass):''}</td>

          <td>${fieldValue(bean: articleInstance, field: "title")}</td>

          <td>${fieldValue(bean: articleInstance, field: "viewTimes")}</td>

          <td><g:link action="show" id="${articleInstance.id}">详细</g:link></td>

          <td><g:formatDate date="${articleInstance.createAt}" /></td>

          <td><g:formatDate date="${articleInstance.lastModifyAt}" /></td>

          </tr>
        </g:each>
        </tbody>
      </table>
    </div>
    <div class="paginateButtons">
      <g:paginate total="${articleInstanceTotal}" />
    </div>
  </div>
</body>
</html>
